<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_docente" name="form_docente" class="form-horizontal"
	action="<?php echo url_for('docente/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_docente='.$form->getObject()->getIdDocente() : '')) ?>"
	method="post">
	<?php if (!$form->getObject()->isNew()): ?> 
	<input type="hidden" name="sf_method" value="put" /> 
	<input type="hidden" name="id_docente" value="<?php echo $form->getObject()->getIdDocente() ?>" /> 
	<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
	
	<?php echo $form->renderGlobalErrors() ?>
	
	<div class="tabs" style="margin-bottom: 9px;">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#tab1" data-toggle="tab">Dados do Docente</a></li>
			<li><a href="#tab2" data-toggle="tab">Documentos</a></li>
			<li><a href="#tab3" data-toggle="tab">Ficha Funcional</a></li>
			<li><a href="#tab4" data-toggle="tab">Dependentes</a></li>
			<li><a href="#tab5" data-toggle="tab">Afastamentos/Férias</a></li>
		</ul>
		<div class="tab-content">
			<div class="tab-pane active" id="tab1">
				<?php include_partial('form_docente', array('form' => $form)) ?>
			</div>
			<div class="tab-pane" id="tab2">
				<?php include_partial('form_documentos', array('form' => $form)) ?>
			</div>
			<div class="tab-pane" id="tab3">
				<?php include_partial('form_funcional', array('form' => $form)) ?>
			</div>
			<div class="tab-pane" id="tab4">
				<?php include_partial('form_dependentes', array('form' => $form)) ?>
			</div>
			<div class="tab-pane" id="tab5">
				<?php include_partial('form_ferias', array('form' => $form)) ?>
			</div>
		</div>
	</div>

<?php
	comandos_form(
		submit_tag(':: Salvar ::', array('class' => 'btn btn-info')),
		link_to(
			':: Voltar ::',
			$sf_context->getModuleName().'/list',
			array('class' => 'btn')
		)
	);
?>
</form>

<script type="text/javascript">
	$(function(){
		$('.tabs').tabs();
		System.formdata.save(new Array("msgAlerta", "Atenção:"), true, "$('.tabs').tabs('load',1);");
	});
</script>